/**
 * @author     Gabor Greif <ggreif@gmail.com>
 * @copyright  2009-2010 Gabor Greif
 * @license    http://www.opensource.org/licenses/mit-license.php  MIT License
 * @version    Release: 0.0
 */

#ifndef micker_CERROR_hpp
#define micker_CERROR_hpp

#include "Command.hpp"

namespace micker {

struct Error : Comm<>
{
    static std::string canonical;

    Error(void)
    : Comm<>(proc)
    {}

    static std::string proc(Env& env, const std::string& name, const std::deque<std::string>& args)
    {
        canonical = std::string("[") + name + " ";
        /// todo: check 1 arg
        return canonical + quote(args.front()) + "]";
    }

    static bool isError(const std::string&);
};

} // namespace micker

#endif // micker_CERROR_hpp
